﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class a2 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "LeaveTime",
                table: "Leave",
                newName: "LeaveStartTime");

            migrationBuilder.RenameColumn(
                name: "CreatTime",
                table: "Leave",
                newName: "LeaveEndTime");

            migrationBuilder.RenameColumn(
                name: "CreatName",
                table: "Leave",
                newName: "CrearName");

            migrationBuilder.RenameColumn(
                name: "LeaveId",
                table: "Leave",
                newName: "Id");

            migrationBuilder.AlterColumn<DateTime>(
                name: "UpdateTime",
                table: "Leave",
                type: "datetime2",
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "datetime2");

            migrationBuilder.AddColumn<DateTime>(
                name: "CrearTime",
                table: "Leave",
                type: "datetime2",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "Leave",
                type: "bit",
                nullable: false,
                defaultValue: false);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CrearTime",
                table: "Leave");

            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "Leave");

            migrationBuilder.RenameColumn(
                name: "LeaveStartTime",
                table: "Leave",
                newName: "LeaveTime");

            migrationBuilder.RenameColumn(
                name: "LeaveEndTime",
                table: "Leave",
                newName: "CreatTime");

            migrationBuilder.RenameColumn(
                name: "CrearName",
                table: "Leave",
                newName: "CreatName");

            migrationBuilder.RenameColumn(
                name: "Id",
                table: "Leave",
                newName: "LeaveId");

            migrationBuilder.AlterColumn<DateTime>(
                name: "UpdateTime",
                table: "Leave",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                oldClrType: typeof(DateTime),
                oldType: "datetime2",
                oldNullable: true);
        }
    }
}
